/*
 * Powered By cuichen
 * Since 2014 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.manufacturer.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.manufacturer.domain.Manufacturer;
import com.seeyoui.kensite.bussiness.orderlang.manufacturer.persistence.ManufacturerMapper;

/**
 * Manufacturer
 * @author cuichen
 * @version 2.0
 * @since 1.0
 * @date 2018-02-27
 */

@Service
public class ManufacturerService extends BaseService {
	
	@Autowired
	private ManufacturerMapper manufacturerMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public Manufacturer findOne(String id) throws CRUDException{
		return manufacturerMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param manufacturer
	 * @return
	 * @throws CRUDException
	 */
	public List<Manufacturer> findList(Manufacturer manufacturer) throws CRUDException {
		return manufacturerMapper.findList(manufacturer);
	}
	
	/**
	 * 查询所有数据集合
	 * @param manufacturer
	 * @return
	 * @throws CRUDException
	 */
	public List<Manufacturer> findAll(Manufacturer manufacturer) throws CRUDException {
		return manufacturerMapper.findAll(manufacturer);
	}
	
	/**
	 * 查询数据总数
	 * @param manufacturer
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(Manufacturer manufacturer) throws CRUDException {
		return manufacturerMapper.findTotal(manufacturer);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param manufacturer
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(Manufacturer manufacturer) throws CRUDException {
		return manufacturerMapper.findExTotal(manufacturer);
	}
	
	/**
	 * 数据新增
	 * @param manufacturer
	 * @throws CRUDException
	 */
	public void save(Manufacturer manufacturer) throws CRUDException{
		manufacturer.preInsert();
		manufacturerMapper.save(manufacturer);
	}
	
	/**
	 * 数据修改
	 * @param manufacturer
	 * @throws CRUDException
	 */
	public void update(Manufacturer manufacturer) throws CRUDException{
		manufacturer.preUpdate();
		manufacturerMapper.update(manufacturer);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		manufacturerMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param manufacturer
	 * @throws CRUDException
	 */
	public void remove(Manufacturer manufacturer) throws CRUDException{
		manufacturer.preUpdate();
		manufacturerMapper.remove(manufacturer);			
	}
	
}